package cn.practice.chat.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.stream.function.StreamBridge;
import org.springframework.integration.support.MessageBuilder;
import org.springframework.stereotype.Component;

/**
 * @ClassName Producter
 * @Description:
 * @Author A-TAO
 * @Date 2022/11/8
 * @Version V1.0
 **/
@Component
public class Producter {

    @Autowired
    private StreamBridge streamBridge;


    public void sendMessage(String topic, Object message){
        streamBridge.send(topic, MessageBuilder.withPayload(message).build());
    }


}
